package com.imooc.item.service;

import com.imooc.pojo.PagedGridResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 提供的Http服务的接口
 * 接口层要对外提供服务，所以将接口声明为Controller
 * 路径配置在接口层，接口上声明的注解就会继承到实现类
 * 使用Fegin调用的话一定要指定@RequestParam，否则会报错
 */
@RequestMapping("item-comments-api")
@FeignClient("foodie-item-service")
public interface ItemCommentsService {

    /**
     * 我的评价查询 分页
     * @param userId
     * @param page
     * @param pageSize
     * @return
     */
    @GetMapping("myComments")
    public PagedGridResult queryMyComments(@RequestParam("userId") String userId,
                                           @RequestParam(value = "page", required = false) Integer page,
                                           @RequestParam(value = "pageSize", required = false)Integer pageSize);

    @PostMapping("saveComments")
    public void saveComments(@RequestBody Map<String, Object> map);

}
